﻿// =================================================================== 
// 数据实体层(GDIT.Model)实体映射
//====================================================================
// 文件：Mtb_InternalIP.cs
// 项目名称：学院网站
// 创建时间：2012-08-08
// 负责人：ChenZhiGang
// 引用DevExpress.Xpo程序集
// 程序集介绍：内部IP信息实体类
// ===================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Xpo;

namespace GDIT.Model
{
    public class Mtb_InternalIP : PersistentClass
    {
         public Mtb_InternalIP()
            : base()
        {
            this.Modified = false;
        }

         public Mtb_InternalIP(Session theSession)
            : base(theSession)
        {
            this.Modified = false;
        }

        private string _internalIPStart = string.Empty;
        /// <summary>
        /// 内部IP开始段
        /// </summary>
        [DbType("varchar(50)")]
        public string IternalIPStart
        {
            get { return _internalIPStart; }
            set
            {
                if (_internalIPStart != value)
                {
                    _internalIPStart = value;
                    if (!IsLoading) { this.Modified = true; }
                }
            }
        }

        private string _internalIPEnd = string.Empty;
        /// <summary>
        /// 内部IP结束段
        /// </summary>
        [DbType("varchar(50)")]
        public string IternalIPEnd
        {
            get { return _internalIPEnd; }
            set
            {
                if (_internalIPEnd != value)
                {
                    _internalIPEnd = value;
                    if (!IsLoading) { this.Modified = true; }
                }
            }
        }

        /// <summary>
        /// 防止编辑后马上保存
        /// </summary>
        protected override void EndEdit()
        {
            return;
        }

        /// <summary>
        /// 检验数据
        /// </summary>
        /// <returns></returns>
        public override string GetDataError()
        {
            if (this._internalIPStart.Trim().Length == 0) { return string.Format("内部IP开始段不能为空"); }
            if (this._internalIPEnd.Trim().Length == 0) { return string.Format("内部IP结束段不能为空"); }
            return "";
        }
    }
}
